//
//  KVertifiedCommunitiesRequest.m
//  Keping
//
//  Created by 柯平 on 2017/10/10.
//  Copyright © 2017年 柯平. All rights reserved.
//

#import "KVertifiedCommunitiesRequest.h"

@implementation KVertifiedCommunitiesRequest

-(NSString *)requestUrl
{
    return KVertifiedCommunitiesURL;
}

-(KRequestMethod)requestMethod
{
    return KRequestMethodGET;
}

-(id)requestArgument
{
    return nil;
}

-(NSDictionary<NSString *,NSString *> *)requestHeaderFieldValueDictionary
{
    return @{@"Cookie":[KAppConfig sharedConfig].sessionId?:@""};
}

@end

@implementation KSuggestionRequest

-(NSString *)requestUrl
{
    return KAddSuggestionURL;
}

-(KRequestMethod)requestMethod
{
    return KRequestMethodPOST;
}

-(id)requestArgument
{
    return self.params;
}

-(NSDictionary<NSString *,NSString *> *)requestHeaderFieldValueDictionary
{
    return @{@"Cookie":[KAppConfig sharedConfig].sessionId?:@""};
}

@end


@implementation KUpdateCommunityRequest {
    NSString *pathUrl;
};

- (instancetype)initWithId:(NSString *)commutityId {
    if (self = [super init]) {
        pathUrl = [KUpdateCommunityURL stringByReplacingOccurrencesOfString:@"{id}" withString:commutityId];
    }
    return self;
}

-(NSString *)requestUrl
{
    return pathUrl;
}

-(KRequestMethod)requestMethod
{
    return KRequestMethodPOST;
}

-(id)requestArgument
{
    return self.params;
}

-(NSDictionary<NSString *,NSString *> *)requestHeaderFieldValueDictionary
{
    return @{@"Cookie":[KAppConfig sharedConfig].sessionId?:@""};
}

@end

@implementation KVersionRequest

-(NSString *)requestUrl
{
    return KCheckVersionURL;
}

-(KRequestMethod)requestMethod
{
    return KRequestMethodGET;
}

-(id)requestArgument
{
    return self.params;
}

-(NSDictionary<NSString *,NSString *> *)requestHeaderFieldValueDictionary
{
    return @{@"Cookie":[KAppConfig sharedConfig].sessionId?:@""};
}

@end

